package com.stox.ui.swing.widget;

import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.stox.ui.swing.action.NewNavigatorAction;
import com.stox.ui.swing.util.MessageSource;
import com.stox.ui.swing.widget.wrapper.JMenuItem;

@Component
public class NavigatorMenuItem extends JMenuItem implements InitializingBean{
	private static final long serialVersionUID = 1837757893282636858L;

	@Autowired
	private NewNavigatorAction newNavigatorAction;
	
	public NavigatorMenuItem() {
		super(MessageSource.getMessage("Navigator"),KeyEvent.VK_N,ActionEvent.ALT_MASK,"navigator.png");	
	}
	
	@Override
	public void afterPropertiesSet() throws Exception {
		addActionListener(newNavigatorAction);
	}
	
	@Override
	public int getOrder() {
		return 10;
	}
	
	@Override
	public Class<?> getParentClass() {
		return ViewMenu.class;
	}
	
}
